package com.shart.work.core;

import com.google.common.collect.Lists;
import com.shart.work.util.ExcelUtil;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.List;

public class t {

    public static void main(String[] args) throws FileNotFoundException {
        List<User> userList= Lists.newArrayList();
        userList.add(new User(1L,"aaa",12,"1322@189.cn","0",1.2));
        userList.add(new User(2L,"bbb",12,"25584@qq.com","1",11.2));
        userList.add(new User(3L,"cccc",12,"bb@qq.cn","2",311.11));
        ExcelUtil.excelExportLocalMachine(User.class,userList,"用户表格","测试数据","D://test.xls");

        //导入
        List<User> list = ExcelUtil.excelImportLocalMachine("用户表格", new FileInputStream(new File("d://test.xls")), User.class);
        System.out.println(list);
    }
}
